import request from '@/utils/request'

// 查询每日能耗列表
export function listOn(query) {
  return request({
    url: '/system/on/list',
    method: 'get',
    params: query
  })
}

// 查询每日能耗详细
export function getOn(id) {
  return request({
    url: '/system/on/' + id,
    method: 'get'
  })
}

// 新增每日能耗
export function addOn(data) {
  return request({
    url: '/system/on',
    method: 'post',
    data: data
  })
}

// 修改每日能耗
export function updateOn(data) {
  return request({
    url: '/system/on',
    method: 'put',
    data: data
  })
}

// 删除每日能耗
export function delOn(id) {
  return request({
    url: '/system/on/' + id,
    method: 'delete'
  })
}
//获取图表数据
export function consumAndProNLine(deviceName
) {
  return request({
    url: '/device/consumAndProNLine?deviceName=' + deviceName,
    method: 'GET',
    headers: {
      isToken: false
    }
  })
}
// /device/showMonthConsum当月总计
export function monthConsumAPI() {
  return request({
    url: '/device/showMonthConsum',
    method: 'GET',
    headers: {
      isToken: false
    }
  })
}
// 数量、蜡重与能耗比
export function compareAPI(count) {
  return request({
    url: '/device/compareToConsum?count='+count,
    method: 'GET',
    headers: {
      isToken: false
    }
  })
}
// 能耗与数量、蜡重比
export function compareToNumAPI(count) {
  return request({
    url: '/device/compareToNum?count='+count,
    method: 'GET',
    headers: {
      isToken: false
    }
  })
}

